c# find duplicates in list of strings

41

c# see if list contains any duplicates -

var list = new List<string>();

// Fill the list

if(list.Count != list.Distinct().Count())
{
     // Duplicates exist
}

Comments

Submit
0 Comments